package com.colin.aiyi.dao.ImpxUtils;

import com.colin.aiyi.app.Constant;
import com.colin.aiyi.entity.BaseRequest;
import com.colin.aiyi.entity.response.RoleResponse;

import org.xutils.http.RequestParams;

/**
 * Created by hl on 2017/6/9.
 */

public class ImpGetListByCode extends AbsServicexUtils {
    @Override
    public void onSuccess(String result) {
        super.onSuccess(result);
        RoleResponse loginResponse=gson.fromJson(result,RoleResponse.class);
        if (callback==null)
        {
            sendMsgToView(loginResponse);
        }else {
            callback.onSuccess(loginResponse);
        }
    }

    @Override
    public <V> void getObject(V v) {
        super.getObject(v);
        BaseRequest request= (BaseRequest) v;
        RequestParams parem=new RequestParams(Constant.getListByCode);
        parem.addBodyParameter("accessToken", request.getAccessToken());
        parem.addBodyParameter("code",request.getCode());
//        parem.addBodyParameter("type",request.getOrderType());
//        parem.addBodyParameter("operType",String.valueOf(request.isOperType()));
        sendToServer(parem);
    }



}
